package regex;
import java.util.regex.Matcher;
import java.util.regex.Pattern;



public class RegexBugs {
	public static void main(String[] args) {
//		String input = "Change message: bug 3771: beef up default col width for cli pretty print to 36 so we do not truncate Job UUIDs";
//		Pattern pattern = Pattern.compile("bug \\d\\d\\d\\d");
//		Matcher matcher = pattern.matcher(input);
////		System.out.println(matcher.find());
//		System.out.println(matcher.start());
//		System.out.println(matcher.end());
//		System.out.println(input.substring(matcher.start()+4, matcher.end()));
		
		
		String input2 = "<span title=\"/Entity/Company/Gartner\" class=\"Company\" style=\"background-color:#FFCCFF\">Gartner</span> test test<span title=\"/Entity/Company/Gartner\" class=\"Company\" style=\"background-color:#FFCCFF\">ddd</span> test test";
		Pattern pattern2 = Pattern.compile("<span[^>]*>(.*?)</span>");
		Matcher matcher2 = pattern2.matcher(input2);
//		System.out.println(matcher2.find());
		while(matcher2.find()){
			System.out.println(matcher2.group(1));
			System.out.println(matcher2.group(0));
		}
//		System.out.println(matcher2.start());
//		System.out.println(m tcher2.end());
	}
}
